package com.aliyun.oss.controller;

import com.aliyun.oss.pojo.Entity.OrderDetail;
import com.aliyun.oss.pojo.Vo.ResultVO;
import com.aliyun.oss.service.AdminOrderDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/orderDetail")
public class AdminOrderDetailController {
    @Autowired
    private AdminOrderDetailService adminOrderDetailService;
//    根据订单id查询所有的订单详情
    @RequestMapping("/list")
    public ResultVO list(Integer orderId) {
        List<OrderDetail> orderId1 = adminOrderDetailService.list(new QueryWrapper<OrderDetail>().eq("order_id", orderId));
        return ResultVO.success(orderId1);
    }
}
